    (function($, doc) {
            $.init();
            $.ready(function() {                   
                var _getParam = function(obj, param) {
                    return obj[param] || '';
                };
                // 贷款金额
                var userPicker1 = new $.PopPicker();
                userPicker1.setData([{
                    value: '1',
                    text: '500'
                }, {
                    value: '2',
                    text: '1000'
                }, {
                    value: '3',
                    text: '2000'
                }, {
                    value: '4',
                    text: '3000'
                }, {
                    value: '5',
                    text: '5000'
                }, {
                    value: '6',
                    text: '10000'
                }]);
                var P1 = doc.getElementById('Picker1');
                P1.addEventListener('tap', function(event) {
                    userPicker1.show(function(items) {
                        P1.value = items[0].text;                
                    });
                }, false);

                // 贷款期限
                var userPicker2 = new $.PopPicker();
                userPicker2.setData([{
                    value: '1',
                    text: '3天'
                }, {
                    value: '2',
                    text: '一周内'
                }, {
                    value: '3',
                    text: '一月内'
                }, {
                    value: '4',
                    text: '3个月'
                }, {
                    value: '5',
                    text: '6个月'
                }, {
                    value: '6',
                    text: '9个月'
                }, {
                    value: '7',
                    text: '12个月'
                },  {
                    value: '8',
                    text: '24个月'
                }, {
                    value: '9',
                    text: '36个月'
                }, {
                    value: '10',
                    text: '不限'
                }]);
                var P2 = doc.getElementById('Picker2');
                P2.addEventListener('tap', function(event) {
                    userPicker2.show(function(items) {
                        P2.value = items[0].text;                
                    });
                }, false);

                // 身份信息
                var userPicker3 = new $.PopPicker();
                userPicker3.setData([{
                    value: '1',
                    text: '上班族'
                }, {
                    value: '2',
                    text: '企业主'
                }, {
                    value: '3',
                    text: '其他'
                }]);
                var P3 = doc.getElementById('Picker3');
                P3.addEventListener('tap', function(event) {
                    userPicker3.show(function(items) {
                        P3.value = items[0].text;                
                    });
                }, false);

                // 所在地区
                var userPicker4 = new $.PopPicker({
                    layer: 2
                });
                userPicker4.setData(cityData);
                var P4 = doc.getElementById('Picker4');
                P4.addEventListener('tap', function(event) {
                    userPicker4.show(function(items) {
                        P4.value = items[0].text +"-"+ items[1].text;                
                    });
                }, false);

                // 有无信用卡
                var userPicker5 = new $.PopPicker();
                userPicker5.setData([{
                    value: '1',
                    text: '有'
                }, {
                    value: '2',
                    text: '无'
                }]);
                var P5 = doc.getElementById('Picker5');
                P5.addEventListener('tap', function(event) {
                    userPicker5.show(function(items) {
                        P5.value = items[0].text;                
                    });
                }, false);

                // 手机使用时间
                var userPicker6 = new $.PopPicker();
                userPicker6.setData([{
                    value: '1',
                    text: '1-5个月'
                }, {
                    value: '2',
                    text: '6个月以上'
                }]);
                var P6 = doc.getElementById('Picker6');
                P6.addEventListener('tap', function(event) {
                    userPicker6.show(function(items) {
                        P6.value = items[0].text;                
                    });
                }, false);

                // 详情页贷款期限
                var userPicker7 = new $.PopPicker();
                userPicker7.setData([{
                    value: '1',
                    text: '3天'
                }, {
                    value: '2',
                    text: '一周内'
                }, {
                    value: '3',
                    text: '一月内'
                }, {
                    value: '4',
                    text: '3个月'
                }, {
                    value: '5',
                    text: '6个月'
                }, {
                    value: '6',
                    text: '9个月'
                }, {
                    value: '7',
                    text: '12个月'
                },  {
                    value: '8',
                    text: '24个月'
                }, {
                    value: '9',
                    text: '36个月'
                }, {
                    value: '10',
                    text: '不限'
                }]);
                var P7 = doc.getElementById('Picker7');
                P7.addEventListener('tap', function(event) {
                    userPicker7.show(function(items) {
                        P7.value = items[0].text;                
                    });
                }, false);

            });
    })(mui, document);

            // 热门刷新
            // mui.init({
            //     pullRefresh: {
            //         container: '#hotitem',
            //         up: {
            //             callback: pullupRefresh,
            //         }
            //     }
            // });
            // var count = 0;
            // function pullupRefresh() {
            //     setTimeout(function() {
            //         mui('#hotitem').pullRefresh().endPullupToRefresh((++count > 2)); //参数为true代表没有更多数据了。
            //         var table = document.body.querySelector('#hotitem ul');
            //         var cells = document.body.querySelectorAll('#hotitem li');
            //         for (var i = cells.length, len = i + 2; i < len; i++) {
            //             var li = document.createElement('li');
            //             li.className = 'mui-table-view-cell mui-media';
            //             li.innerHTML = '<a href="#details"><div class="mui-media-object mui-pull-left"><img src="../img/pic.jpg" alt=""><p>我来贷-银行贷款</p></div><div class="mui-media-body">     <div class="mui-row"><div class="mui-col-sm-4 mui-col-xs-4 blue">月利率</div><div class="mui-col-sm-8 mui-col-xs-8 t-cent">额度</div></div><div class="mui-row"><div class="mui-col-sm-4 mui-col-xs-4 blue">1%</div><div class="mui-col-sm-8 mui-col-xs-8 t-cent">50000-200000</div></div><p class="mui-ellipsis gray">申请五分钟，最高可借20万！</p></div></a>';
            //             table.appendChild(li);
            //         };
            //     }, 1500);
            // }

            //列表刷新
            // mui.init({
            //     pullRefresh: {
            //         container: '#listitem',
            //         up: {
            //             callback: pullupRefresh2,
            //         }
            //     }
            // });
            // var count2 = 0;
            // function pullupRefresh2() {
            //     setTimeout(function() {
            //         mui('#listitem').pullRefresh().endPullupToRefresh((++count2 > 2)); //参数为true代表没有更多数据了。
            //         var table = document.body.querySelector('#listitem ul');
            //         var cells = document.body.querySelectorAll('#listitem li');
            //         for (var i = cells.length, len = i + 2; i < len; i++) {
            //             var li = document.createElement('li');
            //             li.className = 'mui-table-view-cell mui-media';
            //             li.innerHTML = '<a href="#details"><div class="mui-media-object mui-pull-left"><img src="../img/pic.jpg" alt=""><p>我来贷-银行贷款</p></div><div class="mui-media-body">     <div class="mui-row"><div class="mui-col-sm-4 mui-col-xs-4 blue">月利率</div><div class="mui-col-sm-8 mui-col-xs-8 t-cent">额度</div></div><div class="mui-row"><div class="mui-col-sm-4 mui-col-xs-4 blue">1%</div><div class="mui-col-sm-8 mui-col-xs-8 t-cent">50000-200000</div></div><p class="mui-ellipsis gray">申请五分钟，最高可借20万！</p></div></a>';
            //             table.appendChild(li);
            //         };
            //     }, 1500);
            // }

            //推荐刷新
            // mui.init({
            //     pullRefresh: {
            //         container: '#recomlist',
            //         up: {
            //             callback: pullupRefresh3,
            //         }
            //     }
            // });
            // var count3 = 0;
            // function pullupRefresh3() {
            //     setTimeout(function() {
            //         mui('#recomlist').pullRefresh().endPullupToRefresh((++count3 > 2)); //参数为true代表没有更多数据了。
            //         var table = document.body.querySelector('#recomlist ul');
            //         var cells = document.body.querySelectorAll('#recomlist li');
            //         for (var i = cells.length, len = i + 2; i < len; i++) {
            //             var li = document.createElement('li');
            //             li.className = 'mui-table-view-cell mui-media';
            //             li.innerHTML = '<a href="#details"><div class="mui-media-object mui-pull-left"><img src="../img/pic.jpg" alt=""><p>我来贷-银行贷款</p></div><div class="mui-media-body">     <div class="mui-row"><div class="mui-col-sm-4 mui-col-xs-4 blue">月利率</div><div class="mui-col-sm-8 mui-col-xs-8 t-cent">额度</div></div><div class="mui-row"><div class="mui-col-sm-4 mui-col-xs-4 blue">1%</div><div class="mui-col-sm-8 mui-col-xs-8 t-cent">50000-200000</div></div><p class="mui-ellipsis gray">申请五分钟，最高可借20万！</p></div></a>';
            //             table.appendChild(li);
            //         };
            //     }, 1500);
            // }
mui.init();
            (function($) {
                //阻尼系数
                var deceleration = mui.os.ios?0.003:0.0009;
                $('.mui-scroll-wrapper').scroll({
                    bounce: false,
                    indicators: true, //是否显示滚动条
                    deceleration:deceleration
                });
                $.ready(function() {
                    //循环初始化所有下拉刷新，上拉加载。
                    $.each(document.querySelectorAll('.mui-scroll-wrapper .mui-scroll'), function(index, pullRefreshEl) {
                        $(pullRefreshEl).pullToRefresh({
                            // down: {
                            //     callback: function() {
                            //         var self = this;
                            //         setTimeout(function() {
                            //             var ul = self.element.querySelector('.mui-table-view');
                            //             ul.insertBefore(createFragment(ul, index, 10, true), ul.firstChild);
                            //             self.endPullDownToRefresh();
                            //         }, 1000);
                            //     }
                            // },
                            up: {
                                callback: function() {
                                    var self = this;
                                    setTimeout(function() {
                                        var ul = self.element.querySelector('.mui-table-view');
                                        ul.appendChild(createFragment(ul, index, 2));
                                        self.endPullUpToRefresh();
                                    }, 1000);
                                }
                            }
                        });
                    });
                    var createFragment = function(ul, index, count, reverse) {
                        var length = ul.querySelectorAll('li').length;
                        var fragment = document.createDocumentFragment();
                        var li;
                        for (var i = 0; i < count; i++) {
                            li = document.createElement('li');
                            li.className = 'mui-table-view-cell mui-media';
                            li.innerHTML = '<a href="#details"><div class="mui-media-object mui-pull-left"><img src="../img/pic.jpg" alt=""><p>我来贷-银行贷款</p></div><div class="mui-media-body">     <div class="mui-row"><div class="mui-col-sm-4 mui-col-xs-4 blue">月利率</div><div class="mui-col-sm-8 mui-col-xs-8 t-cent">额度</div></div><div class="mui-row"><div class="mui-col-sm-4 mui-col-xs-4 blue">1%</div><div class="mui-col-sm-8 mui-col-xs-8 t-cent">50000-200000</div></div><p class="mui-ellipsis gray">申请五分钟，最高可借20万！</p></div></a>';
                            fragment.appendChild(li);
                        }
                        return fragment;
                    };
                });
            })(mui);



        if (mui.os.plus) {
             mui.plusReady(function() {
                 setTimeout(function() {
                     mui('#pullrefresh').pullRefresh().pullupLoading();
                 }, 10);

             });
         } else {
             mui.ready(function() {
                 mui('#pullrefresh').pullRefresh().pullupLoading();
             });
         }

    //大图轮播       
    var slider1 = mui("#slider");
        slider1.slider({
            interval: 3000
    }); 